<?php 
$show_validator = true;
include TMPL_PATH.'public/header.phtml';
?>
<script type="text/javascript">
<!--
	$(function(){
	$.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true,width:'200',height:'50'}, function(){this.close();$(obj).focus();})}});
	$("#lang_name").formValidator({onshow:"请输入语言名称",onfocus:"请输入语言名称"}).inputValidator({min:2,onerror:"请输入语言名称"});
 //	$("#lang_code").formValidator({onshow:"请输入语言代码",onfocus:"语言代码只能为两位小写字母"}).inputValidator({min:2,max:2,onerror:"请输入语言代码"}).regexValidator({regexp:"^[a-z]{2}",onerror:"语言代码只能为两位小写字母"});
 	$("#lang_locale").formValidator({onshow:"这种语言可以用于那些国家，请用双字母的简写并用“英文逗号”分隔，如:United States写成 US",onfocus:"这种语言可以用于那些国家，请用双字母的简写并用“英文逗号”分隔，如:United States写成 US"}).inputValidator({min:2,onerror:"请输入请输入应用国家"});

	})
//-->
</script>
<div class="subnav">
    <div class="content-menu ib-a blue line-x">
        <a href="<?php echo U('site/language_list');?>"><em>语言列表</em></a><span>|</span>
        <a href='javascript:;' class="on"><?php echo isset($lang) ? '编辑' : '添加';?>语言</a>
    </div>
</div>
<div class="pad_10">
<form action="__SELF__" method="post" name="myform" id="myform" enctype="multipart/form-data">
<table cellpadding="2" cellspacing="1" class="table_form" width="100%">
	<tr>
		<th width="100">语言名称：</th>
		<td><input type="text" name="name" value="<?php echo isset($lang['name']) ? $lang['name'] : null;?>" id="lang_name"	size="30" class="input-text"></td>
	</tr>
	<tr class="hidden">
		<th>语言中文：</th>
		<td><input type="text" name="name_cn" value="<?php echo isset($lang['name_cn']) ? $lang['name_cn'] : null;?>" id="link_name_cn"	size="30" class="input-text"></td>
	</tr>
	<tr class="hidden">
		<th>语言代码：</th>
		<td><input type="text" name="code" value="<?php echo isset($lang['code']) ? $lang['code'] : null;?>" id="lang_code" size="30" class="input-text"><div class="infoShow">浏览器语言前半部分,如:en-us为 en;中文:zh-cn为zh</div></td>
	</tr>
	<tr>
		<th>应用国家(地区)：</th>
		<td><textarea name="locale" id="lang_locale" style="width: 525px; height: 78px;"><?php echo isset($lang['locale']) ? $lang['locale'] : null;?></textarea></td>
	</tr>
	<tr class="hidden">
		<th>图片：</th>
		<td><input type="text" name="image" value="<?php echo isset($lang['image']) ? $lang['image'] : null;?>"	size="30" class="input-text"></td>
	</tr>
	<tr>
		<th>语言包目录：</th>
		<td>
		<?php if(isset($langDirList) && $langDirList):?>
		<select name="directory">
			<?php foreach ($langDirList as $dir):?>
			<option value="<?php echo $dir;?>" <?php if(isset($lang['directory'])&& $lang['directory']==$dir) echo 'selected';?>><?php echo $dir;?></option>
			<?php endforeach;?>
		</select>
		<?php endif;?>
		<div class="infoShow">如果语言包不存在请联系技术人员</div></td>
	</tr>
<tr>
  <th>排序：</th>
  <td><input type="text" name="listorder" class="input-text" size="5" value="<?php echo isset($lang['listorder']) ? $lang['listorder'] : null;?>"/></td>
</tr>
	<tr>
		<th>显示状态：</th>
		<td><input name="status" type="radio" value="1" <?php echo (!isset($lang['status']) || (isset($lang['status']) && $lang['status']==1)) ? 'checked="checked"' : '';?>>&nbsp;是&nbsp;&nbsp;<input
			name="status" type="radio" value="0" <?php echo (isset($lang['status']) && $lang['status']==0) ? 'checked="checked"' : '';?>>&nbsp;否</td>
	</tr>
</table>
<div class="bk15"></div>
    <input name="dosubmit" type="submit" class="button" value="提交" id="dosubmit" />
</form>
</div>
</body>
</html> 